package pe.gob.sunarp.entidad;

import java.io.Serializable;
import javax.persistence.*;

/**
 * The primary key class for the PARTIDAS_RPU database table.
 * 
 */
@Embeddable
public class PartidasRpuPK implements Serializable {
	//default serial version id, required for serializable classes.
	private static final long serialVersionUID = 1L;
	private String coRegi;
	private String coOficRgst;
	private String nuPart;

    public PartidasRpuPK() {
    }

	@Column(name="CO_REGI", unique=true, nullable=false, length=2)
	public String getCoRegi() {
		return this.coRegi;
	}
	public void setCoRegi(String coRegi) {
		this.coRegi = coRegi;
	}

	@Column(name="CO_OFIC_RGST", unique=true, nullable=false, length=2)
	public String getCoOficRgst() {
		return this.coOficRgst;
	}
	public void setCoOficRgst(String coOficRgst) {
		this.coOficRgst = coOficRgst;
	}

	@Column(name="NU_PART", unique=true, nullable=false, length=8)
	public String getNuPart() {
		return this.nuPart;
	}
	public void setNuPart(String nuPart) {
		this.nuPart = nuPart;
	}

	public boolean equals(Object other) {
		if (this == other) {
			return true;
		}
		if (!(other instanceof PartidasRpuPK)) {
			return false;
		}
		PartidasRpuPK castOther = (PartidasRpuPK)other;
		return 
			this.coRegi.equals(castOther.coRegi)
			&& this.coOficRgst.equals(castOther.coOficRgst)
			&& this.nuPart.equals(castOther.nuPart);

    }
    
	public int hashCode() {
		final int prime = 31;
		int hash = 17;
		hash = hash * prime + this.coRegi.hashCode();
		hash = hash * prime + this.coOficRgst.hashCode();
		hash = hash * prime + this.nuPart.hashCode();
		
		return hash;
    }
}